from selenium import webdriver
import pytest,logging
from Page.Page import Page


@pytest.fixture
def driver():
    logging.info('start')
    driver = webdriver.Edge()
    yield driver
    driver.quit()
    logging.info('stop')
def test_jiuxian1(driver):
    po = Page(driver)
    po.open_url('https://www.jiuxian.com/')
    po.login_loc()
    print(po.userlogin_loc())
    dy1 = po.userlogin_loc()
    assert dy1 in '帐号登录'
    po.username_loc()
    po.password_loc()
    po.sleep(15)
    po.login1_loc()
    po.wait(10)
    po.qd_loc()
    po.sleep(5)
    print(po.dy2_loc())
    dy2 = po.dy2_loc()
    assert dy2 in '白酒'
    po.srk_loc()
    po.srk_loc1()
    po.window_scrollTo(100)
    print(po.dy3_loc())
    dy3 = po.dy3_loc()
    assert dy3 in '我的大学'
    print(po.dy4_loc())
    dy4 = po.dy4_loc()
    assert dy4 == '858.00'
    po.shop_loc()
    po.window_handles()
    print(po.dy5_loc())
    dy5 = po.dy5_loc()
    assert dy5 in '活动促销'
    po.addbuy_loc()
    po.select_loc()
    print(po.dy6_loc())







